package com.example.competionmanagebackend.utils;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

public class PageResult<T> {
    private List<T> data;
    private long totalCount;
    private long pageNo;
    private long pageSize;

    public PageResult(Page<T> page) {
        this.data = page.getRecords();
        this.totalCount = page.getTotal();
        this.pageNo = page.getCurrent();
        this.pageSize = page.getSize();
    }

    // Getters
    public List<T> getData() { return data; }
    public long getTotalCount() { return totalCount; }
    public long getPageNo() { return pageNo; }
    public long getPageSize() { return pageSize; }
}

